/* 5.16 Interactive Loop Control
   this program displays a table of numbers, their squares and cubes
   starting form the number 1. The final number in the table is
   input by the user
*/
#include <stdio.h>
int main()
{
    int num,final;

    printf("Enter the final number for table: ");
    scanf("%d",&final);

    printf("Number Square Cube\n");
    printf("------ ------ ----\n");

    for(num=1;num<=final;num++)
    printf("%3d %7d %6d\n",num,num*num,num*num*num);

    return 0;
}